package com.func.domain.activity.service.quota.policy.impl;

import com.func.domain.activity.model.aggregate.CreateQuotaOrderAggregate;
import com.func.domain.activity.model.valobj.OrderStateVO;
import com.func.domain.activity.repository.IActivityRepository;
import com.func.domain.activity.service.quota.policy.ITradePolicy;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * CreditPayTradePolicy
 * </p>
 *
 * @author Simon
 * @version 2025.03.23.1.0.0
 * @description
 * @since 2025-03-23
 */

@Service("credit_pay_trade")
@AllArgsConstructor
public class CreditPayTradePolicy implements ITradePolicy {
    private final IActivityRepository activityRepository;
    @Override
    public void trade(CreateQuotaOrderAggregate createQuotaOrderAggregate) {
        createQuotaOrderAggregate.setOrderState(OrderStateVO.wait_pay);
        activityRepository.doSaveCreditPayOrder(createQuotaOrderAggregate);
    }
}
